<?php
/**
 * Created by PhpStorm.
 * User: hedx
 * Date: 2016/3/30
 * Time: 16:50
 */

namespace common\mq\models;

use yii\db\ActiveRecord;

/**
 * Class MessageServiceModel
 * @package common\mq\models
 *
 * @property string id
 * @property string queue_name
 * @property int message_priority
 * @property int message_delay_seconds
 * @property string message_batch
 * @property string message_type
 * @property string message_title
 * @property string message_sender
 * @property string message_receiver
 * @property string message_content
 * @property int resolve_status
 * @property int message_phase
 * @property string created_time
 * @property string last_updated_time
 * @property string remark
 */
class MessageServiceModel extends ActiveRecord
{
    //消息状态: 未解析, 解析成功, 解析失败
    const NOT_RESOLVE = 0;
    const RESOLVE_SUCCESS = 1;
    const RESOLVE_FAIL = 2;

    //消息过程: 已创建(未发送), 已发送(未接收), 已接收
    const PHASE_CREATED = 0;
    const PHASE_SENT = 5;
    const PHASE_RECEIVED = 10;

    //消息类型: 1队列模型 2发布订阅模型
    const MESSAGE_TYPE_QUEUE = 1;
    const MESSAGE_TYPE_TOPIC = 2;

    public static function tableName()
    {
        return "b2b_support.bizp_message_service";
    }
}